package com.xjoyt.pay.operater.controllers;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.xjoyt.pay.controllers.AbstractController;
import com.xjoyt.pay.dto.ExecuteResult;
import com.xjoyt.pay.dto.PageParam;
import com.xjoyt.pay.dto.PageResult;
import com.xjoyt.pay.operater.auth.interfaces.DepartmentContract;
import com.xjoyt.pay.operater.auth.po.Department;
import com.xjoyt.pay.operater.services.DepartmentService;

@RestController
@RequestMapping("department")
public class DepartmentController extends AbstractController implements DepartmentContract {

	@Autowired
	private DepartmentService service;

	@Override
	public PageResult<Department> loadPage(@RequestBody PageParam<?> param) {
		return service.loadPage(param);
	}

	@Override
	public ExecuteResult<Department> save(@RequestBody Department param) {
		return service.save(param);
	}

	@Override
	public ExecuteResult<?> remove(@PathVariable("id") String id) {
		return service.delete(id);
	}
}
